package com.hh.erp;

import com.hh.erp.entity.request.SysUserRequest;
import com.hh.erp.service.SysDeptService;
import com.hh.erp.service.SysDictDataService;
import com.hh.erp.service.SysUserService;
import com.hh.erp.util.JsonUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.sql.DataSource;

@RunWith(SpringRunner.class)
@SpringBootTest
public class RunWithApplication {

    @Autowired
    private SysUserService userService;
    @Autowired
    private SysDictDataService dictDataService;

    @Autowired
    private SysDeptService deptService;

    @Autowired
    private DataSource dataSource;


    public String getToken() {
        String token = userService.login("admin","123456");
        return token;
    }

    @Test
    public void Test() {
        String token = getToken();
        SysUserRequest request = new SysUserRequest();
        System.out.println(JsonUtil.toJson(userService.selectPageUserList(request)));
    }
}
